<!DOCTYPE html>


  <html class="dark page-post">


<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  
  <title>Emmet：HTML/CSS代码快速编写神器 | Poetry&#39;s Blog</title>

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

  
    <meta name="keywords" content="Emmet,">
  

  <meta name="description" content="前端开发必备！Emmet使用手册">
<meta name="keywords" content="Emmet">
<meta property="og:type" content="article">
<meta property="og:title" content="Emmet：HTML&#x2F;CSS代码快速编写神器">
<meta property="og:url" content="http://blog.poetries.top/2016/03/14/Emmet：HTML-CSS代码快速编写神器/index.html">
<meta property="og:site_name" content="Poetry&#39;s Blog">
<meta property="og:description" content="前端开发必备！Emmet使用手册">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2327/301ff5c9-3604-3dd3-a206-6d3516861ec4.jpg">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2329/0070e820-1cbf-3f42-8c5b-838e5774d02b.gif">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2331/cb250aef-3b60-3297-86ba-8c3ed36cacad.gif">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2333/167e1956-4ac6-3b6d-9025-8bf90fee1250.gif">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2335/47ae82f5-4fd8-36a1-9b4e-d148237537ee.gif">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2337/ae3a8b58-244a-3680-9f0c-d0cab459fc41.gif">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2339/363af658-650f-38d1-ad0e-9608df9d2873.gif">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2341/cf5613ac-4198-326e-a651-a08ad206800a.gif">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2343/a1c5f9d8-d187-3bde-895b-2e14fb428184.gif">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2345/21a47a7c-2d38-3231-8b4b-7d15f38be57a.gif">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2347/2c8cccf4-be54-3190-b1e7-3713717e2a78.gif">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2349/4c2c81e2-ebba-367e-a4fd-4f667d08ca84.gif">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2351/a68eda57-f573-343c-81b8-19e0a48c08fe.gif">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2353/f39213f9-5d68-3728-8cf3-7964aaa02bae.gif">
<meta property="og:image" content="http://dl.iteye.com/upload/attachment/0083/2355/87a3d500-1798-3050-b7e0-df51c94bd203.gif">
<meta property="og:updated_time" content="2020-08-15T04:25:31.898Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Emmet：HTML&#x2F;CSS代码快速编写神器">
<meta name="twitter:description" content="前端开发必备！Emmet使用手册">
<meta name="twitter:image" content="http://dl.iteye.com/upload/attachment/0083/2327/301ff5c9-3604-3dd3-a206-6d3516861ec4.jpg">

  

  
    <link rel="icon" href="/favicon.ico">
  

  <link href="/css/styles.css?v=c114cbeddx" rel="stylesheet">
<link href="/css/other.css?v=c114cbeddx" rel="stylesheet">


  
    <link rel="stylesheet" href="/css/personal-style.css">
  

  

  
  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?40b1f89aa80f2527b3db779c6898c879";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>


  
  <script type="text/javascript">
	(function(){
	    var bp = document.createElement('script');
	    var curProtocol = window.location.protocol.split(':')[0];
	    if (curProtocol === 'https') {
	        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
	    }
	    else {
	        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
	    }
	    var s = document.getElementsByTagName("script")[0];
	    s.parentNode.insertBefore(bp, s);
	})();
  </script>



  
    <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.3.0/css/font-awesome.min.css">
  

  <!-- 聊天系统 -->
  
    
   <link type="text/css" rel="stylesheet" href="/renxi/default.css">
   <style>
      #modal {
        position: static !important;
      }
      .filter {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        background: #fe5757;
        animation: colorChange 30s ease-in-out infinite;
        animation-fill-mode: both;
        mix-blend-mode: overlay;
      }
  
      @keyframes colorChange {
        0%, 100% {
            opacity: 0;
        }
        50% {
            opacity: .9;
        }
      }
   </style>
</head>
</html>
<body>
  
  
    <span id="toolbox-mobile" class="toolbox-mobile">导航</span>
  

  <div class="post-header CENTER">
   
  <div class="toolbox">
    <a class="toolbox-entry" href="/">
      <span class="toolbox-entry-text">导航</span>
      <i class="icon-angle-down"></i>
      <i class="icon-home"></i>
    </a>
    <ul class="list-toolbox">
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/archives/"
            rel="noopener noreferrer"
            target="_self"
            >
            博客
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/categories/"
            rel="noopener noreferrer"
            target="_self"
            >
            分类
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/tags/"
            rel="noopener noreferrer"
            target="_self"
            >
            标签
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/search/"
            rel="noopener noreferrer"
            target="_self"
            >
            搜索
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/link/"
            rel="noopener noreferrer"
            target="_self"
            >
            友链
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/about/"
            rel="noopener noreferrer"
            target="_self"
            >
            关于
          </a>
        </li>
      
    </ul>
  </div>


</div>


  <div id="toc" class="toc-article">
    <strong class="toc-title">文章目录<i class="iconfont toc-title" style="display:inline-block;color:#87998d;width:20px;height:20px;">&#xf004b;</i></strong>
    <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#快速编写HTML代码"><span class="toc-text">快速编写HTML代码</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#初始化"><span class="toc-text">初始化</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#嵌套"><span class="toc-text">嵌套</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#分组"><span class="toc-text">分组</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#隐式标签"><span class="toc-text">隐式标签</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#定义多个元素"><span class="toc-text">定义多个元素</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#定义多个带属性的元素"><span class="toc-text">定义多个带属性的元素</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#CSS缩写"><span class="toc-text">CSS缩写</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#值"><span class="toc-text">值</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#附加属性"><span class="toc-text">附加属性</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#模糊匹配"><span class="toc-text">模糊匹配</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#供应商前缀"><span class="toc-text">供应商前缀</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#前缀缩写如下："><span class="toc-text">前缀缩写如下：</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#渐变"><span class="toc-text">渐变</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#附加功能"><span class="toc-text">附加功能</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#生成Lorem-ipsum文本"><span class="toc-text">生成Lorem ipsum文本</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#定制"><span class="toc-text">定制</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#针对不同编辑器的插件"><span class="toc-text">针对不同编辑器的插件*</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Emmet官网文档："><span class="toc-text">Emmet官网文档：</span></a></li></ol>
  </div>
  




<div class="content content-post CENTER">
   <!-- canvas 彩带 -->
<canvas id="evanyou" width="1302" height="678" style="position: fixed;width: 100%;height: 100%;top: 0;left:0;z-index:-1;"></canvas>

<article id="post-Emmet：HTML-CSS代码快速编写神器" class="article article-type-post" itemprop="blogPost">
  <header class="article-header" style="position:relative;">
    <h1 class="post-title">Emmet：HTML/CSS代码快速编写神器</h1>

    <div class="article-meta">
      <span>
        <i class="icon-calendar"></i>
        <span>2016.03.14</span>
      </span>

      
        <span class="article-author">
          <i class="icon-user"></i>
          <span>Poetry</span>
        </span>
      

      
  <span class="article-category">
    <i class="icon-list"></i>
    <a class="article-category-link" href="/categories/Front-End/">Front-End</a>
  </span>



      

      
      <i class="fa fa-eye"></i> 
        <span id="busuanzi_container_page_pv">
           &nbsp热度 <span id="busuanzi_value_page_pv">
           <i class="fa fa-spinner fa-spin"></i></span>℃
        </span>
      
      
       
          <span class="post-count">
            <i class="fa fa-file-word-o"></i>&nbsp
            <span>字数统计 1.3k字</span>
          </span>

          <span class="post-count">
            <i class="fa fa-columns"></i>&nbsp
            <span>阅读时长 5分</span>
          </span>
      
      
    </div>

    <i class="iconfont" id="toc-eye" style="display:inline-block;color:#b36619;position:absolute;top:0;right:0;cursor:pointer;
    font-size: 24px;">&#xe61c;</i>

  </header>

  <div class="article-content">
    
      <div id="container">
        <ul>
<li><a href="http://www.w3cplus.com/tools/emmet-cheat-sheet.html" target="_blank" rel="noopener">前端开发必备！Emmet使用手册</a><a id="more"></a></li>
<li>Emmet的前身是大名鼎鼎的<code>Zen coding</code>，如果你从事<code>Web</code>前端开发的话，对该插件一定不会陌生。它使用仿<code>CSS</code>选择器的语法来生成代码，大大提高了<code>HTML/CSS</code>代码编写的速度，比如下面的演示： </li>
</ul>
<p><img src="http://dl.iteye.com/upload/attachment/0083/2327/301ff5c9-3604-3dd3-a206-6d3516861ec4.jpg" alt="此处输入图片的描述"></p>
<ul>
<li>该插件已经改名为Emmet。但Emmet不只改名，还带来了一些新特性。</li>
</ul>
<h3 id="快速编写HTML代码"><a href="#快速编写HTML代码" class="headerlink" title="快速编写HTML代码"></a>快速编写HTML代码</h3><hr>
<h4 id="初始化"><a href="#初始化" class="headerlink" title="初始化"></a>初始化</h4><hr>
<ul>
<li>HTML文档需要包含一些固定的标签，比如<code>&lt;html&gt;</code>、<code>&lt;head&gt;</code>、<code>&lt;body&gt;</code>等，现在你只需要1秒钟就可以输入这些标签。比如输入<code>“!”</code>或<code>“html:5”</code>，然后按<code>Tab</code>键：</li>
</ul>
<p><img src="http://dl.iteye.com/upload/attachment/0083/2329/0070e820-1cbf-3f42-8c5b-838e5774d02b.gif" alt="此处输入图片的描述"></p>
<ul>
<li><code>html:5</code> 或!：用于<code>HTML5</code>文档类型</li>
<li><code>html:xt</code>：用于XHTML过渡文档类型</li>
<li><code>html:4s</code>：用于HTML4严格文档类型</li>
</ul>
<ul>
<li>连续输入元素名称和<code>ID</code>，<code>Emmet</code>会自动为你补全，比如输入<code>p#foo</code>： </li>
</ul>
<p><img src="http://dl.iteye.com/upload/attachment/0083/2331/cb250aef-3b60-3297-86ba-8c3ed36cacad.gif" alt="此处输入图片的描述"></p>
<ul>
<li>连续输入类和<code>id</code>，比如<code>p.bar#foo</code>，会自动生成：<code>Html</code>代码 <code>&lt;p class=&quot;bar&quot; id=&quot;foo&quot;&gt;&lt;/p&gt;</code></li>
</ul>
<p>下面来看看如何定义HTML元素的内容和属性。你可以通过输入h1{foo}和a[href=#]，就可以自动生成如下代码：</p>
<p><code>&lt;h1&gt;foo&lt;/h1&gt;</code><br><code>&lt;a href=&quot;#&quot;&gt;&lt;/a&gt;</code>  </p>
<p><img src="http://dl.iteye.com/upload/attachment/0083/2333/167e1956-4ac6-3b6d-9025-8bf90fee1250.gif" alt="此处输入图片的描述"></p>
<h4 id="嵌套"><a href="#嵌套" class="headerlink" title="嵌套"></a>嵌套</h4><hr>
<ul>
<li>现在你只需要1行代码就可以实现标签的嵌套。 <ul>
<li><code>&gt;</code>：子元素符号，表示嵌套的元素</li>
<li><code>+</code>：同级标签符号</li>
<li><code>^</code>：可以使该符号前的标签提升一行</li>
</ul>
</li>
</ul>
<p><img src="http://dl.iteye.com/upload/attachment/0083/2335/47ae82f5-4fd8-36a1-9b4e-d148237537ee.gif" alt="此处输入图片的描述"></p>
<h4 id="分组"><a href="#分组" class="headerlink" title="分组"></a>分组</h4><hr>
<ul>
<li>你可以通过嵌套和括号来快速生成一些代码块，比如输入<code>(.foo&gt;h1)+(.bar&gt;h2)</code>，会自动生成如下代码：</li>
</ul>
<figure class="highlight html"><table><tr><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"foo"</span>&gt;</span>  </span><br><span class="line">    <span class="tag">&lt;<span class="name">h1</span>&gt;</span><span class="tag">&lt;/<span class="name">h1</span>&gt;</span>  </span><br><span class="line"> <span class="tag">&lt;/<span class="name">div</span>&gt;</span>  </span><br><span class="line"> <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"bar"</span>&gt;</span>  </span><br><span class="line">     <span class="tag">&lt;<span class="name">h2</span>&gt;</span><span class="tag">&lt;/<span class="name">h2</span>&gt;</span>  </span><br><span class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br></pre></td></tr></table></figure>
<p> <img src="http://dl.iteye.com/upload/attachment/0083/2337/ae3a8b58-244a-3680-9f0c-d0cab459fc41.gif" alt="此处输入图片的描述"></p>
<h4 id="隐式标签"><a href="#隐式标签" class="headerlink" title="隐式标签"></a>隐式标签</h4><hr>
<ul>
<li><p>声明一个带类的标签，只需输入<code>div.item</code>，就会生成<code>&lt;div class=&quot;item&quot;&gt;&lt;/div&gt;</code></p>
</li>
<li><p>在过去版本中，可以省略掉div，即输入<code>.item</code>即可生成<code>&lt;div class=&quot;item&quot;&gt;&lt;/div&gt;</code>。现在如果只输入<code>.item</code>，则<code>Emmet</code>会根据父标签进行判定。比如在<code>&lt;ul&gt;</code>中输入<code>.item</code>，就会生成<code>&lt;li class=&quot;item&quot;&gt;&lt;/li&gt;</code>。 </p>
</li>
</ul>
<p><img src="http://dl.iteye.com/upload/attachment/0083/2339/363af658-650f-38d1-ad0e-9608df9d2873.gif" alt="此处输入图片的描述"></p>
<ul>
<li>下面是所有的隐式标签名称：<ul>
<li><code>li</code>：用于<code>ul</code>和<code>ol</code>中</li>
<li><code>tr</code>：用于table、tbody、thead和tfoot中</li>
<li><code>td</code>：用于<code>tr</code>中</li>
<li><code>option</code>：用于<code>select</code>和<code>optgroup</code>中</li>
</ul>
</li>
</ul>
<h4 id="定义多个元素"><a href="#定义多个元素" class="headerlink" title="定义多个元素"></a>定义多个元素</h4><hr>
<ul>
<li>要定义多个元素，可以使用<code>*</code>符号。比如，<code>ul&gt;li*3</code>可以生成如下代码：</li>
</ul>
<figure class="highlight html"><table><tr><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">ul</span>&gt;</span> </span><br><span class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br></pre></td></tr></table></figure>
<p><img src="http://dl.iteye.com/upload/attachment/0083/2341/cf5613ac-4198-326e-a651-a08ad206800a.gif" alt="此处输入图片的描述"></p>
<h4 id="定义多个带属性的元素"><a href="#定义多个带属性的元素" class="headerlink" title="定义多个带属性的元素"></a>定义多个带属性的元素</h4><hr>
<ul>
<li>如果输入 <code>ul&gt;li.item$*3</code>，将会生成如下代码： </li>
</ul>
<figure class="highlight html"><table><tr><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">ul</span>&gt;</span>  </span><br><span class="line">  <span class="tag">&lt;<span class="name">li</span> <span class="attr">class</span>=<span class="string">"item1"</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span>  </span><br><span class="line">  <span class="tag">&lt;<span class="name">li</span> <span class="attr">class</span>=<span class="string">"item2"</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span>  </span><br><span class="line">  <span class="tag">&lt;<span class="name">li</span> <span class="attr">class</span>=<span class="string">"item3"</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span> </span><br><span class="line"><span class="tag">&lt;/<span class="name">ul</span>&gt;</span></span><br></pre></td></tr></table></figure>
<p><img src="http://dl.iteye.com/upload/attachment/0083/2343/a1c5f9d8-d187-3bde-895b-2e14fb428184.gif" alt="此处输入图片的描述"></p>
<h3 id="CSS缩写"><a href="#CSS缩写" class="headerlink" title="CSS缩写"></a>CSS缩写</h3><hr>
<h4 id="值"><a href="#值" class="headerlink" title="值"></a>值</h4><hr>
<ul>
<li>比如要定义元素的宽度，只需输入<code>w100</code>，即可生成 <code>width: 100px;</code>  </li>
</ul>
<p><img src="http://dl.iteye.com/upload/attachment/0083/2345/21a47a7c-2d38-3231-8b4b-7d15f38be57a.gif" alt="此处输入图片的描述"></p>
<ul>
<li>除了<code>px</code>，也可以生成其他单位，比如输入<code>h10p+m5e</code>，结果如下：<ul>
<li><code>height: 10%</code>;  </li>
<li><code>margin: 5em</code>; </li>
</ul>
</li>
<li>单位别名列表：<ul>
<li><code>p</code> 表示<code>%</code></li>
<li><code>e</code> 表示 <code>em</code></li>
<li><code>x</code> 表示 <code>ex</code></li>
</ul>
</li>
</ul>
<h4 id="附加属性"><a href="#附加属性" class="headerlink" title="附加属性"></a>附加属性</h4><hr>
<ul>
<li>可能你之前已经了解了一些缩写，比如 <code>@f</code>，可以生成：</li>
</ul>
<figure class="highlight css"><table><tr><td class="code"><pre><span class="line"><span class="keyword">@font-face</span> &#123; </span><br><span class="line"><span class="attribute">font-family</span>:; </span><br><span class="line">  <span class="attribute">src</span>:<span class="built_in">url</span>();  </span><br><span class="line">  &#125;</span><br></pre></td></tr></table></figure>
<p>一些其他的属性，比如<code>background-image</code>、<code>border-radius</code>、<code>font</code>、<code>@font-face</code>,<code>text-outline</code>、<code>text-shadow</code>等额外的选项，可以通过<code>“+”</code>符号来生成，比如输入<code>@f+</code>，将生成： </p>
<figure class="highlight css"><table><tr><td class="code"><pre><span class="line"><span class="keyword">@font-face</span> &#123;  </span><br><span class="line">  <span class="attribute">font-family</span>: <span class="string">'FontName'</span>;  </span><br><span class="line">  <span class="attribute">src</span>: <span class="built_in">url</span>(<span class="string">'FileName.eot'</span>);  </span><br><span class="line">  <span class="attribute">src</span>: <span class="built_in">url</span>(<span class="string">'FileName.eot?#iefix'</span>) <span class="built_in">format</span>(<span class="string">'embedded-opentype'</span>), <span class="built_in">url</span>(<span class="string">'FileName.woff'</span>) <span class="built_in">format</span>(<span class="string">'woff'</span>),  </span><br><span class="line">       <span class="built_in">url</span>(<span class="string">'FileName.ttf'</span>) <span class="built_in">format</span>(<span class="string">'truetype'</span>),  </span><br><span class="line">       <span class="built_in">url</span>(<span class="string">'FileName.svg#FontName'</span>) <span class="built_in">format</span>(<span class="string">'svg'</span>);  </span><br><span class="line">   <span class="attribute">font-style</span>: normal;  </span><br><span class="line">   <span class="attribute">font-weight</span>: normal;  </span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><img src="http://dl.iteye.com/upload/attachment/0083/2347/2c8cccf4-be54-3190-b1e7-3713717e2a78.gif" alt="此处输入图片的描述"></p>
<h4 id="模糊匹配"><a href="#模糊匹配" class="headerlink" title="模糊匹配"></a>模糊匹配</h4><hr>
<ul>
<li><p>如果有些缩写你拿不准，<code>Emmet</code>会根据你的输入内容匹配最接近的语法，比如输入<code>ov:h</code>、<code>ov-h</code>、<code>ov</code>h和<code>oh</code>，生成的代码是相同的：<br><code>overflow: hidden</code>;</p>
<p><img src="http://dl.iteye.com/upload/attachment/0083/2349/4c2c81e2-ebba-367e-a4fd-4f667d08ca84.gif" alt="此处输入图片的描述"></p>
</li>
</ul>
<h4 id="供应商前缀"><a href="#供应商前缀" class="headerlink" title="供应商前缀"></a>供应商前缀</h4><hr>
<ul>
<li>如果输入非<code>W3C</code>标准的<code>CSS</code>属性，<code>Emmet</code>会自动加上供应商前缀，比如输入<code>trs</code>，则会生成： </li>
</ul>
<figure class="highlight css"><table><tr><td class="code"><pre><span class="line"><span class="selector-tag">-webkit-transform</span>: ; </span><br><span class="line"><span class="selector-tag">-moz-transform</span>: ;  </span><br><span class="line"><span class="selector-tag">-ms-transform</span>: ;  </span><br><span class="line"><span class="selector-tag">-o-transform</span>: ;  </span><br><span class="line"><span class="selector-tag">transform</span>: ;</span><br></pre></td></tr></table></figure>
<p> <img src="http://dl.iteye.com/upload/attachment/0083/2351/a68eda57-f573-343c-81b8-19e0a48c08fe.gif" alt="此处输入图片的描述"></p>
<ul>
<li>你也可以在任意属性前加上<code>“-”</code>符号，也可以为该属性加上前缀。比如输入<code>-super-foo</code>：</li>
</ul>
<figure class="highlight css"><table><tr><td class="code"><pre><span class="line"><span class="selector-tag">-webkit-super-foo</span>: ;  </span><br><span class="line"><span class="selector-tag">-moz-super-foo</span>: ;  </span><br><span class="line"><span class="selector-tag">-ms-super-foo</span>: ;  </span><br><span class="line"><span class="selector-tag">-o-super-foo</span>: ; </span><br><span class="line"><span class="selector-tag">super-foo</span>: ;</span><br></pre></td></tr></table></figure>
<ul>
<li>如果不希望加上所有前缀，可以使用缩写来指定，比如<code>-wm-trf</code>表示只加上<code>-webkit</code>和<code>-moz</code>前缀：</li>
</ul>
<figure class="highlight css"><table><tr><td class="code"><pre><span class="line"><span class="selector-tag">-webkit-transform</span>: ;  </span><br><span class="line"><span class="selector-tag">-moz-transform</span>: ;  </span><br><span class="line"><span class="selector-tag">transform</span>: ;</span><br></pre></td></tr></table></figure>
<h4 id="前缀缩写如下："><a href="#前缀缩写如下：" class="headerlink" title="前缀缩写如下："></a>前缀缩写如下：</h4><hr>
<ul>
<li><code>w</code> 表示 <code>-webkit-</code></li>
<li><code>m</code>表示 <code>-moz-</code></li>
<li><code>s</code> 表示 <code>-ms-</code></li>
<li><code>o</code> 表示 <code>-o-</code></li>
</ul>
<h4 id="渐变"><a href="#渐变" class="headerlink" title="渐变"></a>渐变</h4><hr>
<ul>
<li>输入<code>lg(left, #fff 50%, #000)</code>，会生成如下代码： </li>
</ul>
<figure class="highlight css"><table><tr><td class="code"><pre><span class="line"><span class="selector-tag">background-image</span>: <span class="selector-tag">-webkit-gradient</span>(<span class="selector-tag">linear</span>, 0 0, 100% 0, <span class="selector-tag">color-stop</span>(0<span class="selector-class">.5</span>, <span class="selector-id">#fff</span>), <span class="selector-tag">to</span>(<span class="selector-id">#000</span>));</span><br><span class="line"><span class="selector-tag">background-image</span>: <span class="selector-tag">-webkit-linear-gradient</span>(<span class="selector-tag">left</span>, <span class="selector-id">#fff</span> 50%, <span class="selector-id">#000</span>);</span><br><span class="line"><span class="selector-tag">background-image</span>: <span class="selector-tag">-moz-linear-gradient</span>(<span class="selector-tag">left</span>, <span class="selector-id">#fff</span> 50%, <span class="selector-id">#000</span>);</span><br><span class="line"><span class="selector-tag">background-image</span>: <span class="selector-tag">-o-linear-gradient</span>(<span class="selector-tag">left</span>, <span class="selector-id">#fff</span> 50%, <span class="selector-id">#000</span>);</span><br><span class="line"><span class="selector-tag">background-image</span>: <span class="selector-tag">linear-gradient</span>(<span class="selector-tag">left</span>, <span class="selector-id">#fff</span> 50%, <span class="selector-id">#000</span>);</span><br></pre></td></tr></table></figure>
<p><img src="http://dl.iteye.com/upload/attachment/0083/2353/f39213f9-5d68-3728-8cf3-7964aaa02bae.gif" alt="此处输入图片的描述"></p>
<h3 id="附加功能"><a href="#附加功能" class="headerlink" title="附加功能"></a>附加功能</h3><hr>
<h4 id="生成Lorem-ipsum文本"><a href="#生成Lorem-ipsum文本" class="headerlink" title="生成Lorem ipsum文本"></a>生成Lorem ipsum文本</h4><hr>
<ul>
<li>引用 Lorem ipsum dolor sit amet, consectetur adipisicing elit. Libero delectus.</li>
</ul>
<p><img src="http://dl.iteye.com/upload/attachment/0083/2355/87a3d500-1798-3050-b7e0-df51c94bd203.gif" alt="此处输入图片的描述"></p>
<h3 id="定制"><a href="#定制" class="headerlink" title="定制"></a>定制</h3><hr>
<ul>
<li>你还可以定制Emmet插件： <ul>
<li>添加新缩写或更新现有缩写，可修改<code>[snippets.json][16]</code>文件</li>
<li>更改<code>Emmet</code>过滤器和操作的行为，可修改<code>[preferences.json][17]</code>文件</li>
<li>定义如何生成<code>HTML</code>或<code>XML</code>代码，可修改<code>[syntaxProfiles.json][18]</code>文件</li>
</ul>
</li>
</ul>
<h3 id="针对不同编辑器的插件"><a href="#针对不同编辑器的插件" class="headerlink" title="针对不同编辑器的插件*"></a>针对不同编辑器的插件*</h3><hr>
<ul>
<li>Emmet支持的编辑器如下（链接为针对该编辑器的<code>Emmet</code>插件）： <ul>
<li><a href="https://github.com/sergeche/emmet-sublime" target="_blank" rel="noopener">Sublime Text 2</a></li>
<li><a href="https://github.com/emmetio/Emmet.tmplugin" target="_blank" rel="noopener">TextMate 1.x</a></li>
<li><a href="https://github.com/emmetio/emmet-eclipse" target="_blank" rel="noopener">Eclipse/Aptana</a></li>
<li><a href="https://github.com/emmetio/Emmet.codaplugin" target="_blank" rel="noopener">Coda 1.6 and 2.x</a></li>
<li><a href="https://github.com/emmetio/Emmet.sugar" target="_blank" rel="noopener">Espresso</a></li>
<li><a href="https://github.com/sergeche/emmet.chocmixin" target="_blank" rel="noopener">Chocolat （通过“Install Mixin”对话框添加)</a></li>
<li><a href="https://github.com/emmetio/emmet/downloads" target="_blank" rel="noopener">Komodo Edit/IDE</a> （通过Tools → Add-ons菜单添加)</li>
<li><a href="https://github.com/emmetio/emmet/downloads" target="_blank" rel="noopener">Notepad++</a></li>
<li><a href="https://github.com/emmetio/emmet/downloads" target="_blank" rel="noopener">PSPad</a></li>
<li><a href="https://github.com/emmetio/emmet/downloads" target="_blank" rel="noopener">textarea</a></li>
<li><a href="https://github.com/emmetio/codemirror" target="_blank" rel="noopener">CodeMirror2/3</a></li>
<li><a href="https://github.com/emmetio/brackets-emmet" target="_blank" rel="noopener">Brackets</a></li>
</ul>
</li>
</ul>
<h3 id="Emmet官网文档："><a href="#Emmet官网文档：" class="headerlink" title="Emmet官网文档："></a>Emmet官网文档：</h3><hr>
<ul>
<li><a href="http://emmet.io/download/" target="_blank" rel="noopener">emmet插件下载中心</a></li>
<li><a href="https://github.com/emmetio/emmet" target="_blank" rel="noopener">GitHub主页</a></li>
<li><a href="http://docs.emmet.io/cheat-sheet/" target="_blank" rel="noopener">emmet快捷键表</a></li>
<li><a href="http://docs.emmet.ioio/cheat-sheet/" target="_blank" rel="noopener">emmet文档</a></li>
</ul>

      </div>
    
  </div>

</article>

<button class="assist-btn2 circle" id="assist_btn2" title="点亮屏幕" style="left: 27px; top: 152px;">
  <i class="iconfont" style="display:inline-block;color:red;width:20px;height:20px;">&#xe61d;</i>
</button>
<button class="assist-btn1 circle" id="assist_btn1" title="关闭屏幕亮度" style="left: 27px; top: 152px;">
  <i class="iconfont toc-title" style="display:inline-block;color:red;width:20px;height:20px;">&#xe61d;</i>
</button>


<script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>	

<script src="https://my.openwrite.cn/js/readmore.js" type="text/javascript"></script>
<script>
  const btw = new BTWPlugin();
  btw.init({
    id: "container",
    blogId: "22699-1592137983091-414",
    name: "前端进阶之旅",
    qrcode: "https://poetries1.gitee.io/img-repo/2020/06/qrcode.jpg",
    keyword: "3a3b3c",
  });
</script>

<script type="text/javascript">

// white theme
var body = {color: "#555", background: "#000"};
var a_tag = {color: "#222"};
var header = { background: "#222"};
var logo_line_i = {background: "#222"};
// var post_code = {background: "#eee", color: "#222"};

function switch_theme() {
 $("body").css(body);
 $("a:not('.links-of-author-item a, .site-state-item a, .site-state-posts a, .feed-link a, .motion-element a, .post-tags a, .show-commit-cls a, #donate_board a')").css(a_tag);
 $(".header, .footer").css(header);
 $(".logo-line-before i, .logo-line-after i").css(logo_line_i);
 //$(".post code").css(post_code);
 $("#idhyt-surprise-ball #idhyt-surprise-ball-animation .drag").css(a_tag);
 $(".post-title-link, .posts-expand .post-meta, .post-comments-count, .disqus-comment-count, .post-category a, .post-nav-next a, .post-nav-item a").css(a_tag);
 
 // $("code").css({color: '#c5c8c6', background: '#1d1f21'});
 //$("#assist_btn1").hide(1500);
}

$(function () {
$("#assist_btn2").css("display","none");
 $("#assist_btn1").click(function() {
     switch_theme();
$("div#toc.toc-article").css({
 "background":"#eaeaea",
 "opacity":1
});
$(".toc-article ol").show();
$("#toc.toc-article .toc-title").css("color","#a98602");
$("#assist_btn1").css("display","none");
$("#assist_btn2").css("display","block");
 });
$("#assist_btn2").click(function() {
$("#assist_btn2").css("display","none");
$("#assist_btn1").css("display","block");
$("body").css("background","url(http://www.miaov.com/static/ie/images/news/bg.png)")
     $(".header, .footer").css("background","url(http://www.miaov.com/static/ie/images/news/bg.png)")
$(".toc-article ol").toggle(1000);
 });
});


//背景随机

var Y, O, E, L, B, C, T, z, N, S, A, I;
!function() {
var e = function() {
for (O.clearRect(0, 0, L, B), T = [{
x: 0,
y: .7 * B + C
}, {
x: 0,
y: .7 * B - C
}]; T[1].x < L + C;) t(T[0], T[1])
}, t = function(e, t) {
O.beginPath(), O.moveTo(e.x, e.y), O.lineTo(t.x, t.y);
var n = t.x + (2 * I() - .25) * C,
 r = a(t.y);
O.lineTo(n, r), O.closePath(), N -= S / -50, O.fillStyle = "#" + (127 * A(N) + 128 << 16 | 127 * A(N + S / 3) + 128 << 8 | 127 * A(N + S / 3 * 2) + 128).toString(16), O.fill(), T[0] = T[1], T[1] = {
 x: n,
 y: r
}
}, a = function n(e) {
var t = e + (2 * I() - 1.1) * C;
return t > B || t < 0 ? n(e) : t
};
Y = document.getElementById("evanyou"), O = Y.getContext("2d"), E = window.devicePixelRatio || 1, L = window.innerWidth, B = window.innerHeight, C = 90, z = Math, N = 0, S = 2 * z.PI, A = z.cos, I = z.random, Y.width = L * E, Y.height = B * E, O.scale(E, E), O.globalAlpha = .6, document.onclick = e, document.ontouchstart = e, e()
}()

   
$("#toc-eye").click(function(){
$("#toc.toc-article").toggle(1000);
});

</script>


   
  <div class="text-center donation">
    <div class="inner-donation">
      <span class="btn-donation">支持一下</span>
      <div class="donation-body">
        <div class="tip text-center">扫一扫，支持poetries</div>
        <ul>
        
          <li class="item">
            
              <span>微信扫一扫</span>
            
            <img src="/images/weixin.jpg" alt="">
          </li>
        
          <li class="item">
            
              <span>支付宝扫一扫</span>
            
            <img src="/images/zhifubao.jpg" alt="">
          </li>
        
        </ul>
      </div>
    </div>
  </div>


   
  <div class="box-prev-next clearfix">
    <a class="show pull-left" href="/2016/03/14/企业DIV使用频率高的命名方法/">
        <i class="icon icon-angle-left"></i>
    </a>
    <a class="show pull-right" href="/2016/03/14/编码神器Atom使用详解/">
        <i class="icon icon-angle-right"></i>
    </a>
  </div>




</div>


  <a id="backTop" class="back-top">
    <i class="icon-angle-up"></i>
  </a>




  <div class="modal" id="modal">
  <span id="cover" class="cover hide"></span>
  <div id="modal-dialog" class="modal-dialog hide-dialog">
    <div class="modal-header">
      <span id="close" class="btn-close">关闭</span>
    </div>
    <hr>
    <div class="modal-body">
      <ul class="list-toolbox">
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/archives/"
              rel="noopener noreferrer"
              target="_self"
              >
              博客
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/categories/"
              rel="noopener noreferrer"
              target="_self"
              >
              分类
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/tags/"
              rel="noopener noreferrer"
              target="_self"
              >
              标签
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/search/"
              rel="noopener noreferrer"
              target="_self"
              >
              搜索
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/link/"
              rel="noopener noreferrer"
              target="_self"
              >
              友链
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/about/"
              rel="noopener noreferrer"
              target="_self"
              >
              关于
            </a>
          </li>
        
      </ul>

    </div>
  </div>
</div>



  
      <div class="fexo-comments comments-post">
    

    

    
    

    

    
    

    

<!-- Gitalk评论插件通用代码 -->
<div id="gitalk-container"></div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<script>
const gitalk = new Gitalk({
  clientID: '5567a2c4abb858009d96',
  clientSecret: 'b9039ec056cf5c2346b3cdb63308a28c163f91e5',
  repo: 'poetries.github.io',
  owner: 'poetries',
  // 在这里设置一下截取前50个字符串, 这是因为 github 对 label 的长度有了要求, 如果超过
  // 50个字符串则会报错.
  // id: location.pathname.split('/').pop().substring(0, 49),
  id: location.pathname,
  admin: ['poetries'],
  // facebook-like distraction free mode
  distractionFreeMode: false
})
gitalk.render('gitalk-container')
</script>
<!-- Gitalk代码结束 -->



  </div>

  

  <script type="text/javascript">
  function loadScript(url, callback) {
    var script = document.createElement('script')
    script.type = 'text/javascript';

    if (script.readyState) { //IE
      script.onreadystatechange = function() {
        if (script.readyState == 'loaded' ||
          script.readyState == 'complete') {
          script.onreadystatechange = null;
          callback();
        }
      };
    } else { //Others
      script.onload = function() {
        callback();
      };
    }

    script.src = url;
    document.getElementsByTagName('head')[0].appendChild(script);
  }

  window.onload = function() {
    loadScript('/js/bundle.js?235683', function() {
      // load success
    });
  }
</script>


  <!-- 页面点击小红心 -->
  <script type="text/javascript" src="/js/clicklove.js"></script>
 
  
</body>
</html>
